<style>
    #obj-update {
        padding: 20px 25px 25px 0;
    }

    #obj-update .layui-treeSelect .ztree li a, .ztree li span {
        margin: 0 0 2px 3px !important;
    }
</style>
<div class="layui-fluid" id="obj-update">
    <form class="layui-form" action="" lay-filter="obj-update-form">
                <div class="layui-form-item febs-hide">
                    <label class="layui-form-label febs-form-item-require">记录id：</label>
                    <div class="layui-input-block">
                        <input type="text" name="id" data-th-value="${obj.id}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label febs-form-item-require">业务办理名称：</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">子项：</label>
                    <div class="layui-input-block">
                        <select id="sumItem" name="sumItem" lay-verify="required" >
                            <option value=""></option>
                            <option th:each="o : ${list}" th:value="${o.id}" th:text="${o.name }">
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">事项类别：</label>
                    <div class="layui-input-block">
                        <select id="itemType" name="itemType" >
                            <option value=""></option>
                            <option value="公共服务">公共服务</option>
                            <option value="行政裁决">行政裁决</option>
                            <option value="行政给付">行政给付</option>
                            <option value="行政检查">行政检查</option>
                            <option value="行政奖励">行政奖励</option>
                            <option value="行政确认">行政确认</option>
                            <option value="行政许可">行政许可</option>
                            <option value="行政征收">行政征收</option>
                            <option value="其他职权">其他职权</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">办理地址：</label>
                    <div class="layui-input-block">
                        <select id="addressType" name="addressType" >
                            <option value=""></option>
                            <option value="大厅">大厅</option>
                            <option value="分厅">分厅</option>
                            <option value="大厅/分厅">大厅/分厅</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">服务对象：</label>
                    <div class="layui-input-block">
                        <select id="serviceObject" name="serviceObject" >
                            <option value=""></option>
                            <option value="个人">个人</option>
                            <option value="法人">法人</option>
                            <option value="个人/法人">个人/法人</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">即办事项：</label>
                    <div class="layui-input-block">
                        <select id="immediately" name="immediately" >
                            <option value=""></option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">凭身份证办理：</label>
                    <div class="layui-input-block">
                        <select id="needCard" name="needCard" >
                            <option value=""></option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">通办事项：</label>
                    <div class="layui-input-block">
                        <select id="allCityHandle" name="allCityHandle" >
                            <option value=""></option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">最多跑一次：</label>
                    <div class="layui-input-block">
                        <select id="atMostOnce" name="atMostOnce" >
                            <option value=""></option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">零跑动：</label>
                    <div class="layui-input-block">
                        <select id="zeroRun" name="zeroRun" >
                            <option value=""></option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否网办：</label>
                    <div class="layui-input-block">
                        <select id="onlineCheck" name="onlineCheck" >
                            <option value=""></option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">办理系统：</label>
                    <div class="layui-input-block">
                        <input type="text" name="bussSystem" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">实施层级：</label>
                    <div class="layui-input-block">
                        <input type="text" name="level" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">支持自助终端办理：</label>
                    <div class="layui-input-block">
                        <select id="selfHelp" name="selfHelp" >
                            <option value=""></option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">支持预约办理：</label>
                    <div class="layui-input-block">
                        <select id="appointment" name="appointment" >
                            <option value=""></option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">支持物流快递：</label>
                    <div class="layui-input-block">
                        <select id="express" name="express" >
                            <option value=""></option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否投资事项：</label>
                    <div class="layui-input-block">
                        <select id="investItem" name="investItem" >
                            <option value=""></option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">涉及中介服务：</label>
                    <div class="layui-input-block">
                        <select id="agentService" name="agentService" >
                            <option value=""></option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">办理结果领取方式：</label>
                    <div class="layui-input-block">
                        <select id="collectionMethod" name="collectionMethod" >
                            <option value=""></option>
                            <option value="窗口领取">窗口领取</option>
                            <option value="邮寄">邮寄</option>
                            <option value="电子证照下载">电子证照下载</option>
                            <option value="全部">全部</option>
                        </select>
                    </div>
                </div>
            <div class="layui-form-item febs-hide">
                <button class="layui-btn" lay-submit="" lay-filter="obj-update-form-submit" id="submit"></button>
            </div>
    </form>
</div>

<script data-th-inline="javascript">
    layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect'], function () {
        var $ = layui.$,
            febs = layui.febs,
            layer = layui.layer,
            form = layui.form,
            obj = [[${obj}]],
            $view = $('#obj-update'),
            validate = layui.validate;

        form.verify(validate);
        form.render();

        initobjValue();


        function initobjValue() {
            form.val("obj-update-form", {
                "id": obj.id,
                "name": obj.name,
                "sumItem": obj.sumItem,
                "itemType": obj.itemType,
                "addressType": obj.addressType,
                "serviceObject": obj.serviceObject,
                "immediately": obj.immediately,
                "needCard": obj.needCard,
                "allCityHandle": obj.allCityHandle,
                "atMostOnce": obj.atMostOnce,
                "zeroRun": obj.zeroRun,
                "onlineCheck": obj.onlineCheck,
                "bussSystem": obj.bussSystem,
                "level": obj.level,
                "selfHelp": obj.selfHelp,
                "appointment": obj.appointment,
                "express": obj.express,
                "investItem": obj.investItem,
                "agentService": obj.agentService,
                "collectionMethod": obj.collectionMethod,
            });
        }

        form.on('submit(obj-update-form-submit)', function (data) {
            if (febs.nativeEqual(data.field, obj)) {
                febs.alert.warn('数据未作任何修改！');
                return false;
            }
            febs.post(ctx + 'hallItem/update', data.field, function () {
                layer.closeAll();
                febs.alert.success('数据修改成功');
                $('#febs-obj').find('#query').click();
            });
            return false;
        });
    });
</script>